<template>
<<<<<<< HEAD
  <div class="mod-log">
    <avue-crud
      ref="crud"
      :page="page"
      :data="dataList"
      :option="tableOption"
      @search-change="searchChange"
      @on-load="getDataList"
    >
      <template slot-scope="scope" slot="status">
        <el-button
          class="el-tag el-tag--danger el-tag--small"
          plain
          disabled
          :type="scope.row.status === 1 ? 'primary' : 'danger'"
          size="small"
        >
          {{ scope.row.status === 1 ? "正常" : "禁用" }}
        </el-button>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          @click.stop="upd(scope.row.userId)"
          >编辑</el-button
        >
      </template>
    </avue-crud>
    <AddOrUpdate
      v-if="addOrUpdateVisible"
      ref="addOrUpdate"
      @refreshDataList="getDataList"
    ></AddOrUpdate>
=======
  <div>
    1
>>>>>>> origin/netbook
  </div>
</template>

<script>
<<<<<<< HEAD
import { tableOption } from "@/crud/user/user";
import AddOrUpdate from "./user-add-or-update.vue";
export default {
  data() {
    return {
      dataList: [],
      dataListLoading: false,
      addOrUpdateVisible: false,
      selectionDataList: [],
      tableOption: tableOption,
      page: {
        total: 0, // 总页数
        currentPage: 1, // 当前页数
        pageSize: 10, // 每页显示多少条
      },
    };
  },
  created() {
    this.getDataList();
  },
  components: {
    AddOrUpdate,
  },
  methods: {
    // 获取数据列表
    getDataList(page, params, done) {
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl("/admin/user/page"),
        method: "get",
        params: this.$http.adornParams(
          Object.assign(
            {
              current: page == null ? this.page.currentPage : page.currentPage,
              size: page == null ? this.page.pageSize : page.pageSize,
            },
            params
          )
        ),
      }).then(({ data }) => {
        this.dataList = data.records;
        this.page.total = data.total;
        this.dataListLoading = false;
        if (done) {
          done();
        }
      });
    },
    // 条件查询
    searchChange(params, done) {
      this.getDataList(this.page, params, done);
    },
    // upd(v) {
    //   console.log(v, "upd-v");
    //   this.addOrUpdateVisible = true;
    // },
    upd(v) {
      this.addOrUpdateVisible = true;
      this.$nextTick(() => {
        this.$refs.addOrUpdate.init(v);
      });
    },
  },
};
</script>

<style scoped>
.el-tag--small {
  height: 24px;
  padding: 0 8px;
  line-height: 22px;
}
</style>
=======
export default {

}
</script>

<style>

</style>
>>>>>>> origin/netbook
